<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="incloude/common::common_header(~{::meta},~{::link})"></head>
<head>
    <title>路的尽头在哪 - 登入</title>
    <link rel="stylesheet" type="text/css" th:href="@{~/layuiadmin/style/login.css}" media="all">
</head>
<body>
    <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

        <div class="layadmin-user-login-main">
            <div class="layadmin-user-login-box layadmin-user-login-header">
                <h2>路的尽头在哪</h2>
                <p>后台管理</p>
            </div>
            <form action="/login" method="post">
                <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
                    <div class="layui-form-item">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                        <input type="text" name="username" id="LAY-user-login-username" lay-verify="required" placeholder="用户名" class="layui-input">
                    </div>
                    <div class="layui-form-item">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                        <input type="password" name="password" id="LAY-user-login-password" lay-verify="required" placeholder="密码" class="layui-input">
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-row">
                            <div id="slider"></div>
                        </div>
                    </div>
                    <div class="layui-form-item" style="margin-bottom: 20px;">
                        <input type="checkbox" name="remember" lay-skin="primary" title="记住密码">
                        <a href="forget.html" class="layadmin-user-jump-change layadmin-link" style="margin: 7px;margin-left: 25px;">忘记密码？</a>
                        <a href="reg.html" class="layadmin-user-jump-change layadmin-link" style="margin-top: 7px;">注册帐号</a>
                    </div>
                    <div class="layui-form-item">
                        <button class="layui-btn layui-btn-fluid layui-btn-normal" lay-submit lay-filter="login-submit">登 入</button>
                    </div>

                </div>
            </form>
        </div>

        <div class="layui-trans layadmin-user-login-footer">
            <p>© 2019 <a href="http://shiva.show/" target="_blank">shiva</a></p>
        </div>

    </div>

    <div th:replace="incloude/common::common_js"></div>
    <script>
        layui.config({
            base: '/layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
            ,sliderVerify:'plugins/sliderVerify'
        }).use(['sliderVerify','layer','form','index'], function(){
            var sliderVerify = layui.sliderVerify;
            var layer = layui.layer;
            var form = layui.form;

            //滑块验证
            var slider = sliderVerify.render({
                elem: '#slider',
                onOk: function(){//当验证通过回调
                    layer.msg("验证通过");
                }
            });

            //表单验证
            form.verify();

            //监听提交
            form.on('submit(login-submit)', function(data){
                if(!slider.isOk()){
                    layer.msg("请先通过滑块验证");
                    return false;
                }
                return true;
            });

        });
    </script>

</body>
</html>